This invention relates generally to means and methods for translating between different number systems used in a data processor. More particularly, the invention relates to improved means and methods for providing high speed conversion of binary coded decimal (BCD) numbers to binary form.
In the binary system of notation, each binary digit (bit) represents a different power of 2. The least significant bit represents 2.sup.0, the bit of next significance 2.sup.1, the bit of next significance 2.sup.2 and so on. For example, in straight binary notation, the number 11101 is equal to 1.times.2.sup.4 +1.times.2.sup.3 +1.times.2.sup.2 +0.times.2.sup.1 +1.times.2.sup.0 =29 in decimal notation.
In the binary coded decimal (BCD) system of notation, each group of 4 bits represents one decimal character. The same decimal number 29, as above, is represented in BCD notation by 0010 1001.
In automatic digital computers, it is frequently required to provide for converting BCD numbers to binary form. Various known approaches for providing such BCD-to-binary conversion are described and referenced in the article: "A Method for High Speed BCD-to-binary Conversion", L. C. Beougher, Computer Design, March 1973, pp. 53-59. This article is to be considered as incorporated herein.
In the above referenced Beougher article, an improved BCD-to-binary conversion approach is proposed. The design principle which is followed in the Beougher BCD-to-binary conversion approach is based on the addition of columns of BCD bits produced by a power of 2 expansion of each BCD digit. For example, decimal 89 in BCD notation is 1000 1001 which can be more completely expressed as (1000).sub.2 (10).sub.10 +(1001).sub.2 (1).sub.10 =(1000).sub.2 (8+2).sub.10 +(1001).sub.2 (1).sub.10 =(1000).sub.2 (2.sup.3 +2.sup.1).sub.10 +(1001).sub.2 (2.sup.0).sub.10. As illustrated below, the equivalent binary value 1011001 of BCD number 89 is obtained in accordance with the final expression above (which represents the power of 2 expansion of the BCD number 89) by adding the columns of BCD bits obtained after multiplication by the proper power of 2 value(s) (note that multiplication by a power of 2 in binary arithmetic is accomplished by merely shifting the binary number to the left a number of places equal to the value of the exponent):
______________________________________ (1001).sub.2 (2.sup.0).sub.10 = 1001 = 9 (1000).sub.2 (2.sup.1).sub.10 = 10000 = 16 (1000).sub.2 (2.sup.3).sub.10 = 1000000 = 64 1011001 89 ______________________________________